package c.j.a.d.a.k.a;

import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;

/* compiled from: IntReader */
public class c {
    public InputStream a;
    public boolean b;
    public int c = 0;

    public c(InputStream inputStream, boolean z) {
        this.a = inputStream;
        this.b = z;
    }

    public final int a() throws IOException {
        int i = 0;
        int read;
        if (this.b) {
            int i2 = 24;
            while (i2 >= 0) {
                read = this.a.read();
                if (read != -1) {
                    this.c++;
                    i |= read << i2;
                    i2 -= 8;
                } else {
                    throw new EOFException();
                }
            }
            return i;
        }
        read = 0;
        while (i != 32) {
            int read2 = this.a.read();
            if (read2 != -1) {
                this.c++;
                read |= read2 << i;
                i += 8;
            } else {
                throw new EOFException();
            }
        }
        return read;
    }

    public final int[] b(int i) throws IOException {
        int[] iArr = new int[i];
        int i2 = 0;
        while (i > 0) {
            int i3 = i2 + 1;
            iArr[i2] = a();
            i--;
            i2 = i3;
        }
        return iArr;
    }

    public final void c() throws IOException {
        long j = (long) 4;
        long skip = this.a.skip(j);
        this.c = (int) (((long) this.c) + skip);
        if (skip != j) {
            throw new EOFException();
        }
    }
}
